﻿Imports System.Data.SqlClient
Imports BusinessEntites

Public Class Nhom_CauHoiDA
    Public Sub New()

    End Sub

    Public Function GetListObject() As ListOfNhom_CauHoiObj
        Dim myListObject As New ListOfNhom_CauHoiObj
        Dim arr As New ArrayList
        For Each myrow As DataRow In ExcuteSQL.GetDataSet("NhanVien_SelContent").Tables(0).Rows
            Dim myObj As New Nhom_CauHoiObj
            myObj.Ma_BC = myrow("Ma_BC")
            myObj.Ma_DanhGia = myrow("Ma_DanhGia")
            myObj.Ma_Nhom = myrow("Ma_Nhom")
            myObj.Ma_YKien = myrow("Ma_YKien")
            myListObject.ListOfNhom_CauHoiObj.Add(myObj)
        Next
        Return myListObject
    End Function

    Public Function Insert(ByVal categories As NhanVienObj) As Boolean
        Dim arr As ArrayList
        arr = New ArrayList
        Try
            'arr.Add(New SqlParameter("@Cat_ID", categories.Cat_ID))
            'arr.Add(New SqlParameter("@Cat_Code", categories.Cat_Code))
            'arr.Add(New SqlParameter("@Cat_Name", categories.Cat_Name))
            'arr.Add(New SqlParameter("@Cat_Parent", categories.Cat_Parent))
            'arr.Add(New SqlParameter("@Cat_Level", categories.Cat_Level))
            'arr.Add(New SqlParameter("@Cat_Root", categories.Cat_Root))
            'arr.Add(New SqlParameter("@Actived", categories.Actived))
            'arr.Add(New SqlParameter("@ActionName", "insert"))
            'ExcuteSQL.ExcuteNonQuery("Categories_Man", arr)
            Return True
        Catch
            Return False
        End Try
    End Function

    Public Function Update(ByVal categories As NhanVienObj) As Boolean
        Dim arr As ArrayList
        arr = New ArrayList
        Try
            'arr.Add(New SqlParameter("@Cat_ID", categories.Cat_ID))
            'arr.Add(New SqlParameter("@Cat_Code", categories.Cat_Code))
            'arr.Add(New SqlParameter("@Cat_Name", categories.Cat_Name))
            'arr.Add(New SqlParameter("@Cat_Parent", categories.Cat_Parent))
            'arr.Add(New SqlParameter("@Cat_Level", categories.Cat_Level))
            'arr.Add(New SqlParameter("@Cat_Root", categories.Cat_Root))
            'arr.Add(New SqlParameter("@Actived", categories.Actived))
            'arr.Add(New SqlParameter("@ActionName", "update"))
            'ExcuteSQL.ExcuteNonQuery("Categories_Man", arr)
            Return True
        Catch
            Return False
        End Try
    End Function

    Public Function Delete(ByVal cat_ID As Integer) As Boolean
        Dim arr As ArrayList
        arr = New ArrayList
        Try
            'arr.Add(New SqlParameter("@Cat_ID", cat_ID))
            'arr.Add(New SqlParameter("@ActionName", "deleteByCat_ID"))
            'ExcuteSQL.ExcuteNonQuery("Categories_Man", arr)
            Return True
        Catch
            Return False
        End Try
    End Function

End Class
